<%=content_for :head do%>
<title>Listing users</title>
<%end%>
<%=render "shared/search"%>
<%=render "shared/logon"%>
<%=render "shared/giohang"%>
<%=render "shared/footer"%>
<%=render "shared/menu"%>

<h1>Listing users</h1>

<table>
  <tr>
    <th>Username</th>
    <th>Password</th>
    <th>Email</th>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Level</th>
    <th>Status</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @users.each do |user| %>
  <tr>
    <td><%= user.username %></td>
    <td><%= user.password %></td>
    <td><%= user.email %></td>
    <td><%= user.firstName %></td>
    <td><%= user.lastName %></td>
    <td><%= user.level %></td>
    <td><%= user.status %></td>
    <td><%= link_to 'Show', user %></td>
    <td><%= link_to 'Edit', edit_user_path(user) %></td>
    <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New User', new_user_path %>
